package component.sender;

import javax.annotation.Resource;
import javax.jms.Queue;

import org.springframework.jms.core.JmsTemplate;
import org.springframework.stereotype.Component;

import component.Sender;

@Component("merchantSender")
public class MerchantSender implements Sender{

    @Resource(name="jmsTemplate")
    private JmsTemplate jmsTemplate;
    @Resource
    private Queue queue;


    public int send(String msg) {
        this.jmsTemplate.send(this.queue, new MyMessageCreator(msg));
        return 1;
    }
   
}
